{template 'admin','header'}
    <form action="{$self_dir}/perm.php?action=search" name="form"  onsubmit="return r_submit(this);">
    <table cellpadding="0" cellspacing="1" class="table_list">
        <caption>权限元查询</caption>
        <tr>
            <td  class="align_c">
                权限元分类：<select name="pt_code" id="pt_code">
                  <option value="">请选择</option>
                  {loop $type_list $key=>$value}
                    <option value="{$key}">{$value}</option>
                  {/loop}
                </select>
                <script>
                    $("#pt_code").val("{$pt_code}");
                 </script>
                权限元名称：<input type="text" size="30" name="p_name" value="{$p_name}"/>
                <input type="submit" class="button_style" value="查询"/>
            </td>
        </tr>
    </table>
    </form>
    <form action="admin/perm.php?action=listorder" name="form1"  method="POST" onsubmit="return r_submit(this);">
    <table cellpadding="0" cellspacing="1" class="table_list">
        <caption>权限元管理</caption>
        <tr>
            <th width="80" class="align_c"><input type="checkbox" onclick="checkall(this,'pid')" id="chkall">全选/取消</th>
            <th width="5%">排序</th>
            <th width="5%">ID</th>
            <th>权限元编码</th>
            <th>权限元名称</th>
            <th>分类名称</th>
            <th>添加人</th>
            <th>添加时间</th>
            <th width="320">管理操作</th>
        </tr>
        {loop $perm_list $perm}
        <tr>
            <td class="align_c">
                <input id="pid" name="pid[]" type="checkbox" id="checkbox"  value="{$perm['p_id']}"/>
            </td>
            <td class="align_c">
                <input type="text" name="listorder[{$perm['p_id']}]" size="2" value="{$perm['listorder']}"/>
            </td>
            <td class="align_c">{$perm['p_id']}</td>
            <td class="align_c">{$perm['p_code']}</td>
            <td class="align_c">{$perm['p_name']}</td>
            <td class="align_c">{$type_list[$perm['pt_code']]}</td>
            <td class="align_c">{$perm['username']}</td>
            <td class="align_c">{date('Y-m-d H:i:s',$perm['inputtime'])}</td>
            <td class="align_c">
                {if check_perms('P003')===true}<a href="{$self_dir}/perm.php?action=upd&permid={$perm['p_id']}&forward={$forward}">修改</a>&nbsp;|&nbsp;{/if}
                {if check_perms('P004')===true}<a href="javascript:my_request('{format_url("$self_dir/perm.php?action=del&permid=".$perm['p_id'])}','确认要删除吗？')">删除</a>{/if}
            </td>
        </tr>
        {/loop}
    </table>
    <div class="button_box">
        {if check_perms('P005')===true}<input class="button_style" name="order" type="button" value=" 排序 " onclick="change_opt('form1','{$self_dir}/perm.php?action=listorder')"/>{/if}
        {if check_perms('P002')===true}<input class="button_style" name="add" type="button" value=" 添加权限元 " onclick="self.location='{$self_url}?action=add&forward={$forward}'"/>{/if}
        {if check_perms('P004')===true}<input class="button_style" name="del" type="button" value=" 批量删除 " onclick="if(confirm('确定要删除选中的数据？')){change_opt('form1','{$self_dir}/perm.php?action=del_all');}"/>{/if}
    </div>
    </form>
    <div id="pages">
        {$perm_pages}
    </div>
{template 'admin','footer'}
